package com.example.myapplication.util;

import java.io.File;

/**
 * @author: rongfeng
 * @date: 2020/12/1
 * @description
 */
public class UpdateNname {

    public static void main(String[] args) {
        String path = "C:\\Users\\demo\\Downloads\\璀璨星幕新增修改切图\\output";
        File file = new File(path);
        File[] list = file.listFiles();

        // 如果目录下文件存在
        if (file.exists() && file.isDirectory())
        {
            for (int i = 0; i < list.length; i++)
            {

                //取文件名子存入name中
                String name = list[i].getName();

                name = name.replace("@3x","");

                //重命名
                File dest = new File(path+"/" + name);
                list[i].renameTo(dest);


            }
        }
    }

}
